//
//  BCOrderDetailCell.m
//  BangcaiDriver
//
//  Created by apple on 16/9/22.
//  Copyright © 2016年 BC. All rights reserved.
//

#import "BCOrderDetailCell.h"

@implementation BCOrderDetailCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView{
    self.phoneImgView = [[UIImageView alloc ] initWithImage:[UIImage imageNamed:@"电话-1"]];
    self.arrowImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"下一步-灰"]];
    self.topLine = [[UILabel alloc] init];
    self.topLine.backgroundColor = [UIColor colorWithRed:0.890 green:0.890 blue:0.890 alpha:1];
    self.bottomLine = [[UILabel alloc] init];
    self.bottomLine.backgroundColor = [UIColor colorWithRed:0.890 green:0.890 blue:0.890 alpha:1];
    self.midLine = [[UILabel alloc] init];
    self.midLine.backgroundColor = [UIColor colorWithRed:0.890 green:0.890 blue:0.890 alpha:1];
    self.addLab = [[UILabel alloc] init];
    self.addLab.font = [UIFont systemFontOfSize:17];
    self.addLab.textColor = [UIColor blackColor];
    self.timeLab = [[UILabel alloc] init];
    self.timeLab.textColor = [UIColor colorWithRed:1 green:0.633 blue:0.312 alpha:1];
    self.timeLab.font = [UIFont systemFontOfSize:13];
    self.timeLab.textAlignment = NSTextAlignmentRight;
    self.amountLab = [[UILabel alloc] init];
    self.amountLab.textColor = [UIColor colorWithRed:0.565 green:0.565 blue:0.565 alpha:1];
    self.amountLab.font = [UIFont systemFontOfSize:15];
    self.weightLab = [[UILabel alloc] init];
    self.weightLab.textColor = [UIColor colorWithRed:0.565 green:0.565 blue:0.565 alpha:1];
    self.weightLab.textAlignment = NSTextAlignmentRight;
    self.weightLab.font = [UIFont systemFontOfSize:15];

    
    [self.contentView addSubview:self.phoneImgView];
    [self.contentView addSubview:self.arrowImgView];
    [self.contentView addSubview:self.topLine];
    [self.contentView addSubview:self.bottomLine];
    [self.contentView addSubview:self.midLine];
    [self.contentView addSubview:self.addLab];
    [self.contentView addSubview:self.timeLab];
    [self.contentView addSubview:self.amountLab];
    [self.contentView addSubview:self.weightLab];
    
    
    
    
}

- (void)layoutSubviews{
    [self.phoneImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(12);
        make.centerY.mas_equalTo(0);
        make.width.and.height.mas_equalTo(25);
    }];
    
    [self.arrowImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-12);
        make.centerY.mas_equalTo(0);
        make.width.mas_equalTo(14);
        make.height.mas_equalTo(20);
    }];
    
    [self.topLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(self.phoneImgView.mas_top).with.offset(-10);
        make.width.mas_equalTo(1);
        make.centerX.mas_equalTo(self.phoneImgView.mas_centerX);
    }];
    
    [self.bottomLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(0);
        make.top.mas_equalTo(self.phoneImgView.mas_bottom).with.offset(10);
        make.width.mas_equalTo(1);
        make.centerX.mas_equalTo(self.phoneImgView.mas_centerX);

    }];
    
    [self.midLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(0);
        make.height.mas_equalTo(1);
        make.left.mas_equalTo(self.phoneImgView.mas_right).with.offset(12);
        make.right.mas_equalTo(-12);
        
    }];
    
    [self.addLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self.arrowImgView.mas_top).with.offset(7);
        make.left.mas_equalTo(self.midLine.mas_left);
    }];
    
    [self.timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self.addLab.mas_bottom);
        make.right.mas_equalTo(self.arrowImgView.mas_left).with.offset(-12);
    }];
    
    [self.amountLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.arrowImgView.mas_bottom);
        make.left.equalTo(self.addLab);
    }];

    [self.weightLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.amountLab);
        make.right.equalTo(self.timeLab);
        
    }];
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
